package com.gk.study.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.time.LocalDateTime;

@TableName("b_user")
public class User implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    public Long id;
    
    @TableField
    public String username; // 用户名
    
    @TableField
    public String password; // 密码
    
    @TableField(exist = false)
    public String rePassword;
    
    @TableField
    public String nickname; // 昵称
    
    @TableField
    public String avatar; // 头像
    
    @TableField
    public String mobile; // 手机号
    
    @TableField
    public String email; // 邮箱
    
    @TableField
    public Integer gender; // 性别：0-未知，1-男，2-女
    
    @TableField
    public String description; // 个人简介
    
    @TableField
    public String role; // 角色：user-普通用户，admin-管理员
    
    @TableField
    public Integer status; // 状态：1-正常，0-禁用
    
    @TableField
    public Integer score; // 积分
    
    @TableField
    public String token; // 登录token
    
    @TableField
    public LocalDateTime lastLoginTime; // 最后登录时间
    
    @TableField
    public String pushEmail; // 推送邮箱
    
    @TableField
    public Integer pushSwitch; // 推送开关：0-关闭，1-开启
    
    @TableField
    public LocalDateTime createTime;
    
    @TableField
    public LocalDateTime updateTime;
    
    @TableField(exist = false)
    public MultipartFile avatarFile;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getRePassword() { return rePassword; }
    public void setRePassword(String rePassword) { this.rePassword = rePassword; }

    public String getNickname() { return nickname; }
    public void setNickname(String nickname) { this.nickname = nickname; }

    public String getAvatar() { return avatar; }
    public void setAvatar(String avatar) { this.avatar = avatar; }

    public String getMobile() { return mobile; }
    public void setMobile(String mobile) { this.mobile = mobile; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public Integer getGender() { return gender; }
    public void setGender(Integer gender) { this.gender = gender; }

    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }

    public String getRole() { return role; }
    public void setRole(String role) { this.role = role; }

    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }

    public Integer getScore() { return score; }
    public void setScore(Integer score) { this.score = score; }

    public String getToken() { return token; }
    public void setToken(String token) { this.token = token; }

    public LocalDateTime getLastLoginTime() { return lastLoginTime; }
    public void setLastLoginTime(LocalDateTime lastLoginTime) { this.lastLoginTime = lastLoginTime; }

    public String getPushEmail() { return pushEmail; }
    public void setPushEmail(String pushEmail) { this.pushEmail = pushEmail; }

    public Integer getPushSwitch() { return pushSwitch; }
    public void setPushSwitch(Integer pushSwitch) { this.pushSwitch = pushSwitch; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public LocalDateTime getUpdateTime() { return updateTime; }
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }

    public MultipartFile getAvatarFile() { return avatarFile; }
    public void setAvatarFile(MultipartFile avatarFile) { this.avatarFile = avatarFile; }
}
